package com.noahplat.person.pojo;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 功能：就诊记录实体类
 * name:宋彦磊
 * time:2021.02.28
 */

@Data
@Table(name = "tb_medical_record")
public class MedicalRecord implements Serializable {
    @Id
    @KeySql(useGeneratedKeys = true)
    private Long id;   //主键ID
    private Long pid;  //人员ID

    @NotNull(message = "就诊医院不能为空")
    @Length(max = 20)
    private String hospital; //就诊医院

    @NotNull(message = "就诊科室一层分类不能为空")
    @Column(name = "first_depart")
    private Long fdepart; //就诊科室一层分类

    @NotNull(message = "就诊科室二层分类不能为空")
    @Column(name = "second_depart")
    private Long sdepart; //就诊科室二层分类

    @Column(name = "visit_time")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date vtime;  //就诊时间

    @NotNull(message = "病情描述不能为空")
    @Length(max = 1024)
    private String description; //病情描述

    @NotNull(message = "诊断结果不能为空")
    @Length(max = 1024)
    private String result;  //诊断结果

    @NotNull(message = "文件路径不能为空")
    @Length(max = 1024)
    private String filepath;  //病历、处方、化验单、检查单等图片文件路径

    @NotNull(message = "删除标识不能为空")
    @Length(max = 1)
    private String del;//是否删除标识 N未删除 Y删除

    @Transient
    private String fdepartName;//一级科室分类名称

    @Transient
    private String sdepartName;//二级科室分类名称


}
